import { Component, OnInit, ElementRef, Input } from '@angular/core';
import { Router } from '@angular/router';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NzMessageService } from 'ng-zorro-antd';

@Component({
  selector: 'app-inquiryls',
  templateUrl: './inquirystate.component.html',
  styleUrls: ['./inquirystate.component.less'],
})
export class InquiryStatusComponent implements OnInit {

  @Input() status: boolean;

  validateForm: FormGroup;

  constructor(
    private fb: FormBuilder,
  ) { }

  ngOnInit() {
    this.initForm();
  }

  initForm() {
    if (this.status) { // 确认询价
      this.validateForm = this.fb.group({
        'stock': [{ value: '', disabled: false }],
        'proportion': [],
        'principal': [],
        'subscriptionPrincipalProportion': [],
        'principalProportion': [],
        'endDays': []
      });
    } else { // 拒绝询价
      this.validateForm = this.fb.group({
        'refuseResson': ['']
      });
    }
  }

}